
// 表单校验规则由 schema2code 生成，不建议直接修改校验规则，而建议通过 schema2code 生成, 详情: https://uniapp.dcloud.net.cn/uniCloud/schema



const validator = {
  "openid": {
    "rules": [
      {
        "format": "string"
      }
    ]
  },
  "hotel_id": {
    "rules": [
      {
        "format": "string"
      }
    ]
  },
  "hotelName": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "民宿名称"
  },
  "name": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "入住人名称"
  },
  "phone": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "手机号码"
  },
  "arriveTime": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "到达时间"
  },
  "remark": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "备注"
  },
  "startDate": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "入住时间"
  },
  "endDate": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "退房时间"
  },
  "price": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "总价格"
  },
  "dayCount": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "总天数"
  },
  "status": {
    "rules": [
      {
        "format": "number"
      },
      {
        "range": [
          {
            "text": "待入住",
            "value": 0
          },
          {
            "text": "已入住",
            "value": 1
          },
          {
            "text": "已取消",
            "value": 2
          },
          {
            "text": "已删除",
            "value": 3
          }
        ]
      }
    ],
    "defaultValue": 0,
    "label": "订单状态"
  },
  "create_date": {
    "rules": [
      {
        "format": "string"
      }
    ],
    "label": "订单创建时间"
  }
}

const enumConverter = {
  "status_valuetotext": [
    {
      "text": "待入住",
      "value": 0
    },
    {
      "text": "已入住",
      "value": 1
    },
    {
      "text": "已取消",
      "value": 2
    },
    {
      "text": "已删除",
      "value": 3
    }
  ]
}

export { validator, enumConverter }
